package com.demo.ai.functions;

import org.springframework.ai.tool.annotation.Tool;

public class WeatherFunction {

	// 天气查询工具
	@Tool(name = "getWeather", description = "获取城市天气信息")
	public String getWeather(String city) {
		return switch(city) {
			case "北京" -> "25℃ 晴";
			case "上海" -> "28℃ 多云";
			default -> "数据暂不可用";
		};
	}

}